using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public static class UtilExtension
{
    public static T GetOrAddComponent<T>(this GameObject go) where T:MonoBehaviour
    {
        T com = go.GetComponent<T>();
        if(com == null)
        {
            com = go.AddComponent<T>();
        }
        return com;
    }
}
